﻿using Autofac.Extras.DynamicProxy;
using AutoMapper;
using commonFramwork.Interceptor;
using Ef.Repository.Entity;
using Ef.Repository.Interface;
using EF.Framework.Ef;
using EF.Framework.Entity;
using My.BLL.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace My.BLL.NewService
{
    [Intercept(typeof(CallLogger))]
    public class NewMyServices : INewMyServices
    {
        public readonly IDemoRepository _blogsDal;

        public readonly IUserRepository _userRepository;

        public NewMyServices(IDemoRepository blogsDal, IUserRepository userRepository)
        {
            _blogsDal = blogsDal;
            _userRepository = userRepository;
        }

        public virtual TestDto GetBlogs()
        {
            var ss1 = _userRepository.GetById(1);
            Test ss = _blogsDal.GetById(1);
            TestDto dto = Mapper.Map<Test, TestDto>(ss);
            return dto;
        }
        public virtual void InsertBlogs(Test test)
        {
            _blogsDal.Insert(test);
        }
    }
}
